#ifndef DATABASE_TOOL_H
#define DATABASE_TOOL_H

#include <string>
#include <vector>


namespace DBServer
{
namespace Database
{

/* database excutor the command and respond the result for client */
class CommandRespond {
public:
    CommandRespond() = default;
    ~CommandRespond() = default;

    std::string respond;
};

/* analysis the command passed by client */
class CommandRequest {
public:
    /**
     * [0] -> command type
     * [1] -> command key
     * [2] -> command value
    */
    std::string command[3];
    bool is_have_value;
};

/* paser the command  */
class CommandPaser {
public:
    static void paser(std::string&&, CommandRequest&);
};

/* use to translator all kinds of type translation */
class Translator {
public:
    static auto int_to_string(int) -> std::string;
    static auto string_to_int(std::string&) -> int;
    static auto vector_to_string(std::vector<std::pair<std::string, std::string>>&) -> std::string;
    static auto vector_to_string_1(std::vector<std::string>&&) -> std::string;
    static auto string_to_double(std::string&&, double&) -> bool;
};


} // namespace DataBase
} // namespace DBSserver



#endif